home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / cluster_admin.idb / var / cluster / ha / diags / ResourceTypeTests.pl.z / ResourceTypeTests.pl
Perl Script  |  2002-10-15  |  3KB  |  88 lines

  1. #!/usr/sbin/perl
  2. #                                                                         
  3. #  Copyright (C) 1998, Silicon Graphics, Inc.                             
  4. #  All Rights Reserved.                                                   
  5. #                                                                         
  6. #  UNPUBLISHED -- Rights reserved under the copyright laws of the United  
  7. #  States.  Use of a copyright notice is precautionary only and does not  
  8. #  imply publication or disclosure.                                       
  9. #                                                                         
  10. #  THIS SOFTWARE CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION OF     
  11. #  SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION, DISTRIBUTION, OR 
  12. #  DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN    
  13. #  PERMISSION OF SILICON GRAPHICS, INC.                                   
  14. #                                                                         
  15. #  U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND                               
  16. #  Use, duplication or disclosure by the Government is subject to         
  17. #  restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph       
  18. #  (c)(1)(ii) of the Rights in Technical Data and Computer Software       
  19. #  clause at DFARS 252.227-7013 and/or in similar or successor clauses    
  20. #  in the FAR, or the DOD or NASA FAR Supplement.  Unpublished-- rights   
  21. #  reserved under the copyright laws of the United States.                
  22. #  Contractor/manufacturer is Silicon Graphics, Inc.,                     
  23. #  2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.                 
  24. #
  25.  
  26. require "$LibDiagsPath/constants.pl";
  27. require "$LibDiagsPath/libdiags.pl";
  28. require "$LibDiagsPath/recurse.pl";
  29.  
  30. # PerformResourceTypesTests
  31. #    Execute all the resources for given resource types.
  32. #
  33. sub PerformResourceTypesTests {
  34.     
  35.   local ($machine_name) = @_;
  36.   local ($l_child, $l_value_me, $l_no_of_children, $l_parameter_list);
  37.   local ($cmd,$exclude); 
  38.   local ($retv)=0;
  39.   local (@resources,$resource);
  40.  
  41.   &LogEntry();
  42.  
  43.   $exclude=0;
  44.   if ($ResourceType eq ALL) {
  45.     @resources=GetAllConfiguredResources();
  46.   } else {
  47.     $resources[0]=$ResourceType;
  48.   }
  49.  
  50.   # For each resource in the resource list, execute the appropriate 
  51.   # tests.
  52.   foreach $resource (@resources) {
  53.     # Perform a quick check on the resource types
  54.     if (!ExistResourcesOnDisk($machine_name, $resource)) {
  55.       &Log("resource type %s does not exists on disk", 
  56.        $resource);
  57.     }elsif (!ExistResourceInCDB($machine_name, $resource)) {
  58.       &Log("resource type %s does not exists in CDB", 
  59.        $resource);
  60.     } else {
  61.       # For the given resource load the resource Perl script, then execute
  62.       # the main entry point.
  63.       if (!($retv=&AutoLoad($resource))) {
  64.     &Error(0,"Failed to autoload the required resource type %s diagnostics,
  65.             $resource");
  66.       } else {
  67.           &Status("Testing %s resources on node %s ***",
  68.                $resource,$machine_name);
  69.           $function="&".$resource."(\"$machine_name\",\"$Resource\")";
  70.           $retv=eval($function);
  71.           &Log("running function: %s: return value %d",$function,$retv);
  72.     }
  73.     }
  74.   }
  75. }
  76.     
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.